package imper.graphic;

import imper.graphic.listener.ChangeViewListener;
import imper.graphic.view.EnumView;

import org.newdawn.slick.state.StateBasedGame;

import de.matthiasmann.twl.Button;

import TWLSlick.RootPane;

public class BarMenu
{
  private StateBasedGame _StateBasedGame = null;

  protected Button btn =null;
  protected Button btn2 =null;

  
  public BarMenu(StateBasedGame pStateBasedGame)
  {
    _StateBasedGame = pStateBasedGame;
  }

  public void getBarMenu(RootPane pRootPane)
  {
    btn = new Button("Hello");   
    btn.addCallback(new ChangeViewListener(EnumView.INDUSTRYVIEW, _StateBasedGame));
    pRootPane.add(btn);
    
    System.out.println("Heps");
    btn2 = new Button("Hello2");
    btn2.addCallback(new Runnable()
    {
      public void run()
      {
        System.out.println("It works!");
      }
    });
    //btn2.addCallback(new ChangeViewListener(EnumView.INDUSTRYVIEW, _StateBasedGame));
    pRootPane.add(btn2);
    
  }
  
  public  void layoutRootPane()
  {
	  btn.adjustSize();
	  btn.setPosition(100, 10);
	  btn2.adjustSize();
	    btn2.setPosition(100, 100);
  }
}
